package com.group3.fallback.product;

import com.group3.Feign.ProductServiceFeign;
import com.group3.common.result.ApiResponse;
import com.group3.model.Product;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class ProductServiceFallback implements ProductServiceFeign {
    @Override
    public Product getProductByPid(Integer pid) {
        Product product=new Product();
        product.setPname("商品服务不可用");
        return product;
    }

    @Override
    public List<Product> getAllProducts() {
        Product product=new Product();
        product.setPname("商品服务不可用");

        return List.of(product);
    }

    @Override
    public ApiResponse publishProduct(Integer pid) {

        return ApiResponse.error("商品服务不可用");
    }

    @Override
    public ApiResponse unpublishProduct(Integer pid) {
        return ApiResponse.error("商品服务不可用");
    }

    @Override
    public boolean decreaseStock(Integer pid, Integer number) {
        return false;
    }

    @Override
    public boolean increaseStock(Integer pid, Integer number) {
        return false;
    }

    @Override
    public ApiResponse<List<Product>> getProductsByPids(List<Integer> pids) {
        return null;
    }
}
